package com.uzai.common.enums;

/**
 * @Auther: xiaoyuexl
 * @Date: 2021/8/16 16:43
 * @Description: 设备授权类型
 */
public enum DeviceAuthTypeEnum {
    /**
     * 试用授权
     */
    DAT_FREE(0,"试用"),

    /**
     * 按月购买授权
     */
    DAT_MONTH(1,"按月购买"),

    /**
     * 按年购买授权
     */
    DAT_YEAR(2,"按年购买"),
    /**
     * 按年购买授权
     */
    DAT_TRANSFER(3,"机器人转移");

    private Integer id;
    private String desc;

    DeviceAuthTypeEnum(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static DeviceAuthTypeEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (DeviceAuthTypeEnum type: DeviceAuthTypeEnum.values()) {
            if (type.getId().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
